package com.bdqn.qnnews.wemedia.api.feign;

import com.bdqn.qnnews.common.base.R;
import com.bdqn.qnnews.wemedia.api.config.WeMediaFeignConfig;
import com.bdqn.qnnews.wemedia.api.dto.WmUserDto;
import com.bdqn.qnnews.wemedia.api.fallback.WeMediaFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author xlzhang
 * @date 2023/12/27 8:52
 */
@FeignClient(name = "qnnews-wemedia-service",path = "/api/v1",
        configuration = WeMediaFeignConfig.class,
        fallbackFactory = WeMediaFeignFallback.class)
public interface WeMediaFeignClient {

    @GetMapping("/user")
    R<WmUserDto> findByName(@RequestParam("name") String name);

    /**
     * 当前保存用户信息后，需要返回用户信息给调用方法
     * @param wmUserDto
     * @return
     */
    @PostMapping("/user")
    R<WmUserDto> save(@RequestBody WmUserDto wmUserDto);

}
